import com.dinmax.flash.gsa.communication.*
import com.dinmax.flash.gsa.communication.action.player.*
import com.dinmax.flash.gsa.communication.parser.*
import com.dinmax.flash.gsa.sgs.player.*

class ActionPlayerSetFounds extends ActionPlayer{
	
	function execute(messageData:XMLNode):CommunicationEvent {
		
		var player:Player = new Player();
				
		var nodes:Array=getNode(messageData, "DATA"); 
		
		for(var i:Number=0; i < nodes.length; i++){
			
			switch (getAttribute(nodes[i], "TYPE")) {
			
			case "Balance":
				player.setBalance(BalanceParser.parse(nodes[i]));
				break;

			default:
				trace("ActionPlayerSetFounds.as");
				break;
						
			}; // fin switch
			
		};
		
		//WOW! Si creo el objeto com antes del SGSGames, se va todo al carajo
		var com:CommunicationEventPlayer=new CommunicationEventPlayer();
		com.setPlayer(player);
				
		return com;

	};
}; // fin de clase